package com.xxc.exam.convert

import com.fasterxml.jackson.databind.JavaType
import com.fasterxml.jackson.databind.type.TypeFactory
import com.fasterxml.jackson.databind.util.Converter
import org.springframework.stereotype.Component
import java.sql.Time
import java.text.SimpleDateFormat

@Component
class TimeConverter : org.springframework.core.convert.converter.Converter<String,Time> {
    override fun convert(source: String): Time? {
        val format = SimpleDateFormat("HH:mm")
        return Time(format.parse(source).time)
    }


}